/**
  mensei-system: An inventory and point-of-sale system for Mensei Enterprise
  Copyright (C) 2011 Aldo Balagulan, Patrick Calulo, Wyn Manlim

  This file is part of mensei-system.

  mensei-system is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  mensei-system is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with mensei-system.  If not, see <http://www.gnu.org/licenses/>.
  */

/*
  ShinyList code is based on code from:
  http://qt-articles.blogspot.com/2010/07/how-to-customize-listview-in-qt-using.html

  Coding style modified, and made more object-oriented
 */
#include "shinylist.h"

ShinyList::ShinyList(QWidget *parent) :
    QListView(parent)
{
    this->itemModel = new QStandardItemModel;
    this->delegate = new ShinyListDelegate;

    this->setModel(itemModel);
    this->setItemDelegate(delegate);
}

void ShinyList::addItem(ShinyListItem *item)
{
    this->itemModel->appendRow(item);
}

void ShinyList::clear()
{
    this->itemModel->clear();
}
